(read_escape): Signal an error for invalid \UXXXXXXXX.
authorKenichi Handa <handa@m17n.org>
Fri, 27 Feb 2009 00:48:03 +0000 (00:48 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 27 Feb 2009 00:48:03 +0000 (00:48 +0000)
src/lread.c

index 063adba1d9ac1f98b5e4ff88ecbe4e4cd5a1e416..e4ba5229e203b1de396daa2f30cc92a2855acf9a 100644 (file)
@@ -2205,7 +2205,7 @@ read_escape (readcharfun, stringp)
       /* A Unicode escape. We only permit them in strings and characters,
         not arbitrarily in the source code, as in some other languages.  */
       {
-       int i = 0;
+       unsigned int i = 0;
        int count = 0;
 
        while (++count <= unicode_hex_count)
@@ -2222,7 +2222,8 @@ read_escape (readcharfun, stringp)
                break;
              }
          }
-
+       if (i > 0x10FFFF)
+         error ("Non-Unicode character: 0x%x", i);
        return i;
       }